MSC4262: Sliding Sync Extension: Profile Updates#4262
Conversation
There was a problem hiding this comment.
Implementation requirements:
- Client
- Server
There was a problem hiding this comment.
Implementation authors should be aware that their implementations (especially Synapse) may currently differ from the accepted underlying MSC4186: Simplified Sliding Sync document contents. See the bottom of that MSC for a list of implementation differences.
This MSC is written against the accepted version of MSC4186's definition of sliding sync.
| { | ||
| "users": { | ||
| "@alice:example.com": { | ||
| "displayname": "Alice", | ||
| "avatar_url": "mxc://example.com/abc123", | ||
| "org.example.language": "en-GB" | ||
| }, | ||
| "@bob:example.com": { | ||
| "displayname": null // Field removal | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
I'm looking at implementing this for Element X but it isn't immediately clear to me where in the SSS response this is expected to be. Could you clarify if it is
- as shown here and becomes a new top-level object.
- nested within the
extensionsobject (it seems slightly odd that the extension would be calledprofilesbut the object returned is then calledusers). - adding the custom profile fields to an existing
userse.g. if there is such a thing withinrooms.
| - If true, the server MAY include recent profile changes that occurred before the sync | ||
|
|
||
| 4. On an initial sync: | ||
| - Profile data MUST only be sent for rooms returned in the sliding sync response |
There was a problem hiding this comment.
How does this interact with the lazy_members flag? Presumably it should only return the profile data for members that have been included in the rooms response too, otherwise the initial sync could be massive if it includes e.g. matrix-hq?
There was a problem hiding this comment.
We ended up doing this to avoid performance problems in the legacy sync variant of this MSC: https://github.com/matrix-org/matrix-spec-proposals/pull/4429/changes#diff-ff7b92bd96566832eba816741b724860e898458319a5e7aaf3bb4626b629fb07R175
|
|
||
| ### Behaviour | ||
|
|
||
| 1. The extension only returns profile updates for users who are members of rooms that the client is |
There was a problem hiding this comment.
Out of interest, is it expected for the user's own profile to be included too? This would provide a nice way to subscribe to the user's global profile for changes from other devices which I don't think exists right now (and maybe it could be included, even if the user isn't part of any rooms). Either way, the MSC should presumably explicitly mention the expected behaviour here.
There was a problem hiding this comment.
I had a similar question while reviewing MSC4186. There, a leave for a given room is only sent down to the client if the room that was left was previously sent to the client in that connection.
Seems this MSC could specify a similar rule when choosing which rooms to include profile updates for.
| } | ||
| ``` | ||
|
|
||
| If `enabled` is `true`, then the sliding sync response MAY include profile updates in the following format: |
There was a problem hiding this comment.
I've also been wondering how this extension would interact with the heroes portion of the sync response too. Would the idea be that the client keeps track of these global profiles and automatically merges the new fields (i.e. everything but avatar/name) with each room's heroes?
| - Profile updates MUST be sent as the server receives them | ||
| - For rooms which initially appear (`initial: true`) due to direct subscriptions or rooms moving | ||
| into the sliding window, current profile states MUST be included | ||
| - A null value for a field indicates the field has been removed |
There was a problem hiding this comment.
This conflicts with the profile endpoints of the CS API where setting a value to null doesn't remove the profile field, and might be an acceptable value since extended profiles were merged into the spec.
From the definition of PUT /profile/{userId}/{keyName}:
Servers MAY reject
nullvalues. Servers that acceptnullvalues SHOULD store them rather than treatingnullas a deletion request. Clients that want to delete a field, including its key and value, SHOULD use theDELETEendpoint instead.
anoadragon453
left a comment
There was a problem hiding this comment.
@tcpipuk would you be opposed to myself taking over updating and maintaining this MSC? Element are currently looking to implement it as part of our work on MSC4426: User Status Profile Fields.
| This MSC is an extension to [MSC3575](https://github.com/matrix-org/matrix-spec-proposals/pull/3575) | ||
| (and its proposed successor [MSC4186](https://github.com/matrix-org/matrix-spec-proposals/pull/4186)) | ||
| which adds support for receiving profile updates via Sliding Sync. It complements |
There was a problem hiding this comment.
This MSC should be updated to focus on extending MSC4186, now that it has been accepted.
There was a problem hiding this comment.
Implementation authors should be aware that their implementations (especially Synapse) may currently differ from the accepted underlying MSC4186: Simplified Sliding Sync document contents. See the bottom of that MSC for a list of implementation differences.
This MSC is written against the accepted version of MSC4186's definition of sliding sync.
|
|
||
| ### Behaviour | ||
|
|
||
| 1. The extension only returns profile updates for users who are members of rooms that the client is |
There was a problem hiding this comment.
I had a similar question while reviewing MSC4186. There, a leave for a given room is only sent down to the client if the room that was left was previously sent to the client in that connection.
Seems this MSC could specify a similar rule when choosing which rooms to include profile updates for.
| 3. The optional `include_history` argument controls whether the initial sync includes recent | ||
| historical profile changes: | ||
| - If false (default), only current profile states are sent on initial sync | ||
| - If true, the server MAY include recent profile changes that occurred before the sync |
There was a problem hiding this comment.
Why would a client want previous profile data? Do homeservers even store historical profile state (Synapse doesn't)?
There was a problem hiding this comment.
I believe the objective was to show changes that occurred within the last minute or two before sync to understand whether a field has just updated, but a little time has passed so it's entirely possible I was on crack! 😄
| - If true, the server MAY include recent profile changes that occurred before the sync | ||
|
|
||
| 4. On an initial sync: | ||
| - Profile data MUST only be sent for rooms returned in the sliding sync response |
There was a problem hiding this comment.
We ended up doing this to avoid performance problems in the legacy sync variant of this MSC: https://github.com/matrix-org/matrix-spec-proposals/pull/4429/changes#diff-ff7b92bd96566832eba816741b724860e898458319a5e7aaf3bb4626b629fb07R175
| No unstable prefix as Sliding Sync is still in review. To enable this extension, add this to your | ||
| request JSON: |
|
Thank you for the offer, @anoadragon453 - I've let this one lapse because of a lot of life events over the last 12 months, so would be all too happy for you to shepherd this one through for Element (and the community's) benefit! 😊 |
Rendered
Signed-off-by: Tom Foster tom@tcpip.uk
Known Implementations: